<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
	<link rel="stylesheet" href="../static/lib/bootstrap/3.3.7/css/bootstrap.min.css" th:href="@{/lib/bootstrap/3.3.7/css/bootstrap.min.css}" />
	<style type="text/css">
	html, body, div {
		margin: 0;
		padding: 0;
	}
	</style>
	<script th:src="@{/lib/jquery/jquery-1.12.4.min.js}"></script>
</head>	
<body>
<div style="width:50%; height: 600px; float: left" th:utext="${pageoffice}" id="po_div"></div>
<div style="width:50%; height: 600px; float: right; border: solid 1px; overflow: scroll;" id="pic_div">
	<th:block th:each="pic : ${files}">
		<div th:switch="${pic.type}" style="background-color: #ccc; font-weight: bold;">
			<span th:case="1" th:text="'合同：' + ${pic.oraName}"></span>
			<span th:case="2" th:text="'资料：' + ${pic.oraName}"></span>
			<span th:case="3" th:text="'补录资料：' + ${pic.oraName}"></span>
		</div>
		<th:block th:each="p : ${#strings.arraySplit(pic.filename, ';')}">
			<a th:href="@{/download/} + ${p}" target="_blank" th:if="${!(#strings.containsIgnoreCase(p,'png') || #strings.containsIgnoreCase(p,'jpg') || #strings.containsIgnoreCase(p,'jpeg') || #strings.containsIgnoreCase(p,'gif') || #strings.containsIgnoreCase(p,'bmp'))}" style="display: block; margin: 5px" th:text="${pic.oraName}">下载文件</a>
			<img th:src="@{/pic/} + ${p}" style="width: 100%" th:if="${#strings.containsIgnoreCase(p,'png') || #strings.containsIgnoreCase(p,'jpg') || #strings.containsIgnoreCase(p,'jpeg') || #strings.containsIgnoreCase(p,'gif') || #strings.containsIgnoreCase(p,'bmp')}"/>
		</th:block>
	</th:block>
</div>

<div>
<span style="display: inline-block; margin-top: 10px">
合同资料：
<th:block th:each="file : ${files}">
	<a th:href="@{/download/} + ${file.filename}" target="_blank" th:text="${file.oraName}" th:if="${file.type == 2}" style="margin-right: 5px"></a>
</th:block>
</span>
</div>

<script type="text/javascript">
function do_layout() {
	var h = $(window).height();
	var height = (h < 600 ? 600 : h - 60) + 'px';
	$("#po_div").css('height', height);
	$("#pic_div").css('height', height);
}
$(function(){
	do_layout();
	$(window).resize(function(){
		do_layout();
	})
});
function fullScreen() {
    document.getElementById("page_office").FullScreen = !document.getElementById("page_office").FullScreen;
}
function printSet() {
    document.getElementById("page_office").ShowDialog(5); 
}
function printFile() {
     document.getElementById("page_office").ShowDialog(4); 
}
//隐藏/显示 Office工具栏
function office_toolbar() {
    document.getElementById("page_office").OfficeToolbars = !document.getElementById("page_office").OfficeToolbars;
}
//隐藏/显示 标题栏
function title_bar() {
    document.getElementById("page_office").Titlebar = !document.getElementById("page_office").Titlebar;
}
function close(){
	window.external.close(); 
}
</script>
</body>
</html>
